import 'package:flutter/material.dart';
import 'package:flutter_study_app/widget/my_app_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ArchivesStatisticsDetailPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _ArchivesStatisticsDetailPageState();
}

class _ArchivesStatisticsDetailPageState
    extends State<ArchivesStatisticsDetailPage> {
  final List<String> _itemList = [
    '合同编号',
    '借据编号',
    '经办机构号',
    '经办机构名称',
    '产品名称',
    '贷款用途',
    '客户姓名',
    '贷款金额',
    '贷款余额',
    '贷款起期',
    '贷款止期'
  ];

  _buildStatisticsDetailItemView(int index) {
    return Container(
      color: Colors.white,
      padding: EdgeInsets.only(
          left: 12.w, right: 12.w, bottom: 12.w, top: index == 0 ? 20.w : 0),
      child: Row(
        children: [
          Text(
            _itemList[index],
            style: TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
          ),
          SizedBox(
            width: 20.w,
          ),
          Expanded(
            child: Text(
              '',
              textAlign: TextAlign.right,
              style: TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
            ),
          )
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        title: '档案管理',
      ),
      body: ListView.builder(
          itemCount: _itemList.length,
          itemBuilder: (context, index) {
            return _buildStatisticsDetailItemView(index);
          }),
    );
  }
}
